import VueRouter from "vue-router"
import Login from '../pages/Login.vue'
import Content from '../pages/Content.vue'
import Index from '../pages/Index'
import UserManage from '../pages/manage/UserManage'
import Swagger  from '../pages/manage/swagger/Swagger'
import DataManage from '../pages/manage/DataManage'
import DataBaseManage from '../pages/manage/DataBaseManage'
import LogsManage from '../pages/manage/LogsManage'
const router = new VueRouter({
    routes: [{
        name: 'login',
        path: '/login',
        meta:{
        title:'登录'
        },
        component: Login
    }, {
        name: 'content',
        path: '/content',
        meta:{
        title:'云顶之译'
        },
        component:Content,
        children:[
            {
                name:'usermanage',
                path:'usermanage',
                meta:{
                    title:'用户管理'
                },
                component:UserManage
            },
            {
                    name:'swagger',
                    path:'swagger',
                    meta:{
                        title:'接口管理'
                    },
                    component:Swagger
            },
            {
                name:'dataManage',
                path:'dataManage',
                meta:{
                    title:'数据统计'
                },
                component:DataManage
            },{
                name:'dataBaseManage',
                path:'dataBaseManage',
                meta:{
                    title:'数据库管理'
                },
                component:DataBaseManage
            },
            {
                name:'logsManage',
                path:'logsManage',
                meta:{
                    title:'日志管理'
                },
                component:LogsManage,
                props:true
            }
        ]
    },{
        name:'index',
        path:'/index',
        component:Index
    }
]
})
router.afterEach((to,from)=>{
    document.title = to.meta.title
})
export default router